package generator.website;

import java.util.Iterator;
import org.eclipse.emf.common.util.EList;
import CarProject.*;
import CarProject.impl.*;;

public class CreationVueMenu
{
  protected static String nl;
  public static synchronized CreationVueMenu create(String lineSeparator)
  {
    nl = lineSeparator;
    CreationVueMenu result = new CreationVueMenu();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = " " + NL + "" + NL + "" + NL + "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"" + NL + "\"http://www.w3.org/TR/html4/loose.dtd\">" + NL + "<html>" + NL + "<head>" + NL + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">" + NL + "<title>";
  protected final String TEXT_2 = "\"</title>" + NL + "</head>" + NL + "<body>" + NL + "\t<h1>" + NL + "\t\t";
  protected final String TEXT_3 = NL + "\t</h1>" + NL + "\t";
  protected final String TEXT_4 = NL + "\t<h2>" + NL + "\t\t<a href=\"";
  protected final String TEXT_5 = ".do\" name=\"";
  protected final String TEXT_6 = "\">";
  protected final String TEXT_7 = "</a>" + NL + "\t</h2>" + NL + "\t";
  protected final String TEXT_8 = NL + "</body>" + NL + "</html>";

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
     VueMenu vue = (VueMenu) argument; 
    EList<VueGenerale> listVue = vue.getDirige();
    stringBuffer.append(TEXT_1);
    stringBuffer.append(vue.getNomVue());
    stringBuffer.append(TEXT_2);
    stringBuffer.append(vue.getNomVue());
    stringBuffer.append(TEXT_3);
    for (int i = 0;i<listVue.size();i++){
    stringBuffer.append(TEXT_4);
    stringBuffer.append(((VueGenerale)listVue.get(i)).getNomVue());
    stringBuffer.append(TEXT_5);
    stringBuffer.append(((VueGenerale)listVue.get(i)).getNomVue());
    stringBuffer.append(TEXT_6);
    stringBuffer.append(vue.getNomVue());
    stringBuffer.append(TEXT_7);
    }
    stringBuffer.append(TEXT_8);
    return stringBuffer.toString();
  }
}
